#include <bits/stdc++.h>
using namespace std;

int n_div_k(int n, int k)
{
	int cnt = 0;
	while (n >= k && (n % k == 0))
	{
		cnt++;
		n /= k;
	}
	return cnt;
}

int main()
{
	ios::sync_with_stdio(false); // 关闭IO同步
	cin.tie(nullptr), cout.tie(nullptr);
	// istringstream iss{string{istreambuf_iterator<char>{cin},
	//                       istreambuf_iterator<char>{}}}; // 将输入一次全部读入输入缓冲区
	// ostringstream oss;                                       // 将输出放入输出缓冲区
	// int t;                                                   // t个case
	// iss >> t;
	// while (t--)
	// {
	// }

	// cout << oss.str(); // 将输出缓冲区一次全部输出

	int n, k;
	cin >> n >> k;
	vector<int> nums(n, 0);
	vector<int> prefix2(n + 1, 0);
	vector<int> prefix5(n + 1, 0);
	for (int i = 0; i < n; i++)
	{
		cin >> nums[i];
		prefix2[i + 1] = prefix2[i] + n_div_k(nums[i], 2);
		prefix5[i + 1] = prefix5[i] + n_div_k(nums[i], 5);
	}
	if (min(prefix2[n], prefix5[n]) < k)
	{
		cout << 0 << endl;
		return 0;
	}

	// 滑动窗口
	int left = 0, right = 0, total2 = 0, total5 = 0;
	long long res = 0;
	while (right < n)
	{
		right++;
		total2 = prefix2[n] - prefix2[right] + prefix2[left];
		total5 = prefix5[n] - prefix5[right] + prefix5[left];
		while (left < right && min(total2, total5) < k)
		{
			left++;
			total2 = prefix2[n] - prefix2[right] + prefix2[left];
			total5 = prefix5[n] - prefix5[right] + prefix5[left];
		}
		res += (right - left);
	}
	cout << res << endl;

	return 0;
}
// 64 位输出请用 printf("%lld")